<?php
namespace addons\wwh\model;

use think\Db;
use think\Model;

class Archives extends Model
{
    // 表名
    protected $name = 'wwh_archives';


    public static function getService()
    {
        $result = Db::name('wwh_service')->where('id', 1)->find();
        return $result;
    }

    public static function getAbout()
    {
        $result = Db::name('wwh_about')->where('id', 1)->find();
        return $result;
    }

    public static function getContact()
    {
        $result = Db::name('wwh_contact')->where('id', 1)->find();
        return $result;
    }

    public static function getConfig()
    {
        $result = Db::name('wwh_config')->where('id', 1)->find();
        return $result;
    }

    public static function getMarket()
    {
        $result = Db::name('wwh_market')->select();
        return $result;
    }

    public static function getNewsTop($limit)
    {
        $result = self::where(['status' => '1','classify'=>'news'])->order('views desc')->limit($limit)->select();
        return $result;
    }

    public static function getDevelopment()
    {
        $result = Db::name('wwh_development')->order('id asc')->select();
        return $result;
    }

}
